<tabs></tabs>

<div class="container statistics">
  <h1>Statistics</h1>
  <div ng-repeat="unit in game.unitlist()">{{unit.label}}</div>
  <div class="table-responsive" ng-init="unitlist = (game.unitlist() | filter:showStats)">
    <table class="table" ng-if="unitlist.length > 0">
      <tr>
        <th>unit</th>
        <th>first bought</th>
        <th>clicks</th>
        <th>bought manually</th>
        <th>twins</th>
      </tr>
      <tbody>
        <tr ng-repeat="unit in unitlist" ng-init="ustats = unitStats(unit)">
          <td class="name">{{unit.unittype.label}}</td>
          <td>{{ustats.elapsedFirstStr}}</td>
          <td>{{ustats.clicks | bignum}}</td>
          <td>{{ustats.num | bignum}}</td>
          <td>{{ustats.twinnum | bignum}}</td>
        </tr>
      </tbody>
    </table>
    <div ng-if="unitlist.length == 0">
      No units purchased.
    </div>
  </div>
  <div class="table-responsive" ng-init="upgradelist = (game.upgradelist() | filter:hasUpgradeStats)">
    <table class="table" ng-if="upgradelist.length > 0">
      <tr>
        <th>upgrade</th>
        <th>first bought</th>
        <th>clicks</th>
        <th>total bought</th>
      </tr>
      <tbody>
        <tr ng-repeat="upgrade in upgradelist" ng-init="ustats = upgradeStats(upgrade)">
          <td class="name">{{upgrade.type.label}}</td>
          <td>{{ustats.elapsedFirstStr}}</td>
          <td>{{ustats.clicks | number}}</td>
          <td>{{ustats.num | number}}</td>
        </tr>
      </tbody>
    </table>
    <div ng-if="upgradelist.length == 0">
      No upgrades purchased.
    </div>
  </div>
  <dl class="dl-horizontal">
    <dt>save file size</dt>
    <dd>{{session.exportSave().length | number}} base64 chars</dd>
    <dt>start date</dt>
    <dd>{{game.momentStarted().fromNow()}} - {{game.dateStarted().toString()}}</dd>
    <dt>last ascended</dt>
    <dd ng-if="game.unit('ascension').count().isZero()">never</dd>
    <dd ng-if="!game.unit('ascension').count().isZero()">{{game.session.state.date.restarted|momentFromNow}} - {{game.session.state.date.restarted.toString()}}</dd>
  </dl>
</div>
